<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "tba_deliveryinfo".
 *
 * @property integer $ID
 * @property string $DeliveryID
 * @property string $DeliveryName
 * @property string $Address
 * @property string $LinkName
 * @property string $LinkTel
 * @property string $QQ
 * @property string $Email
 * @property integer $SortID
 * @property integer $State
 *
 * @property TmeOrderinfo[] $tmeOrderinfos
 */
class TbaDeliveryinfo extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'tba_deliveryinfo';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['DeliveryID', 'DeliveryName', 'Address'], 'required'],
            [['SortID', 'State'], 'integer'],
            [['DeliveryID'], 'string', 'max' => 10],
            [['DeliveryName', 'LinkName', 'LinkTel'], 'string', 'max' => 20],
            [['Address'], 'string', 'max' => 150],
            [['QQ', 'Email'], 'string', 'max' => 50]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'DeliveryID' => 'Delivery ID',
            'DeliveryName' => 'Delivery Name',
            'Address' => 'Address',
            'LinkName' => 'Link Name',
            'LinkTel' => 'Link Tel',
            'QQ' => 'Qq',
            'Email' => 'Email',
            'SortID' => 'Sort ID',
            'State' => 'State',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getTmeOrderinfos()
    {
        return $this->hasMany(TmeOrderinfo::className(), ['TBa_ID' => 'ID', 'DeliveryName' => 'DeliveryName']);
    }
}
